home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / FredFish PD 312.adf / TrackSalve / Source / ts.h < prev    next >
C/C++ Source or Header  |  1990-02-12  |  3KB  |  88 lines

  1.  
  2. #define exit(i)  XCEXIT(i)
  3.  
  4. #define TSSEMAPHORENAME         "TrackSalve Data Hook"
  5. #define TD_VERSION1_2           33
  6. #define TD_REVISION1_2          127
  7. #define TD_VERSION1_3           34
  8. #define TD_REVISION1_3          1
  9.  
  10. #define PUBCLR                  (MEMF_PUBLIC|MEMF_CLEAR)
  11.  
  12. /*  Program return codes  */
  13.  
  14. #define ZERO                    0
  15. #define WARNING                 5
  16. #define SERIOUS                 10
  17. #define FAILURE                 20
  18.  
  19. /*  Secondary result codes  */
  20.  
  21. #define E_CMDLINE               -41
  22. #define E_ALLOCMEM              -42
  23. #define E_INTUITION             -43
  24. #define E_RTAG                  -44
  25. #define E_TD_VERSION            -45
  26. #define E_LOSTPC                -47
  27.  
  28.  
  29. /*--    The findable structure.  We put it in the semaphore list. */
  30.  
  31. struct TSHook{
  32.   struct SignalSemaphore TSH_Semaphore;
  33.   struct TSControl      *TSH_TSControl;
  34.   ULONG                  TSH_Version;
  35. };
  36.  
  37. /*--    The UnitData structure contains data of interest for a Trackdisk unit task. */
  38.  
  39. struct UnitData{
  40.   struct IOExtTD         UD_TDReq;
  41.   struct TSControl      *UD_TSControl;
  42.   char                  *UD_ReturnTD;
  43.   APTR                   UD_Userdata;
  44.   UBYTE                  UD_Cmd0;
  45.   UBYTE                  UD_Cmd1;
  46.   UWORD                  UD_SavedL;
  47.   UWORD                  UD_SavedD;
  48. };
  49.  
  50. /*--    The global control structure.  It contains data concerning shared items between all TD-tasks. */
  51.  
  52. struct TSControl{
  53.   struct TSHook         *TSC_TSHook;
  54.   struct UnitData       *TSC_UnitData[NUMUNITS];
  55.   struct UnitData        TSC_UDAlloc[NUMUNITS];
  56.   struct Resident       *TSC_TDTag;
  57.   ULONG                  TSC_TDCodeSize;
  58.   struct Resident       *TSC_TSTag;
  59.   char                  *TSC_TSCode;
  60.   ULONG                  TSC_TSCodeSize;
  61.   char                  *TSC_Buffer;
  62.   UBYTE                  TSC_InUse;
  63.   UBYTE                  TSC_Salve;
  64.   UBYTE                  TSC_Verify;
  65.   UBYTE                  TSC_AvailUnits;
  66.   struct SignalSemaphore TSC_OwnBuffer;
  67.   struct Library        *TSC_IntuBase;
  68.   ULONG                  TSC_Size;
  69. };
  70.  
  71. /*  Bits of the UD_Command, UD_PreCmd and UNIT_pad */
  72.  
  73. #define B_READONLY              0
  74. #define F_READONLY              (1<<B_READONLY)
  75. #define B_NOCLICK               1
  76. #define F_NOCLICK               (1<<B_NOCLICK)
  77. #define B_SALVE                 2
  78. #define F_SALVE                 (1<<B_SALVE)
  79. #define B_VERIFY                3
  80. #define F_VERIFY                (1<<B_VERIFY)
  81.  
  82. #define B_RAM                   6
  83. #define F_RAM                   (1<<B_RAM)
  84. #define B_TERM                  7
  85. #define F_TERM                  (1<<B_TERM)
  86.  
  87. #define FUNCTIONS               (F_RAM+F_VERIFY+F_SALVE+F_NOCLICK+F_READONLY)
  88.